﻿<Application x:Class="PAARC.WP7.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
             xmlns:services="clr-namespace:PAARC.WP7.Services"
             xmlns:coding4FunControls="clr-namespace:Coding4Fun.Phone.Controls;assembly=Coding4Fun.Phone.Controls"
             xmlns:Binding="clr-namespace:Coding4Fun.Phone.Controls.Binding;assembly=Coding4Fun.Phone.Controls">

    <!--Application Resources-->
    <Application.Resources>
        <!-- Edited style of the InputPrompt to allow the return key and make the text box bigger
             as well as other changes (no border etc.). -->
        <Style TargetType="coding4FunControls:InputPrompt">
            <Setter Property="FontFamily"
                    Value="{StaticResource PhoneFontFamilyNormal}" />
            <Setter Property="FontSize"
                    Value="{StaticResource PhoneFontSizeNormal}" />
            <Setter Property="Foreground"
                    Value="{StaticResource PhoneForegroundBrush}" />
            <Setter Property="Background"
                    Value="{StaticResource PhoneChromeBrush}" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="coding4FunControls:InputPrompt">
                        <Grid>
                            <Rectangle Fill="{StaticResource TransparentBrush}" />

                            <Border VerticalAlignment="Top"
                                    Margin="0"
                                    Background="{TemplateBinding Background}"
                                    BorderThickness="0"
                                    BorderBrush="{StaticResource PhoneForegroundBrush}">

                                <StackPanel Margin="20">
                                    <TextBlock Text="{TemplateBinding Title}"
                                               Margin="0,-10,-25,0"
                                               FontSize="30"
                                               TextWrapping="Wrap"
                                               FontFamily="Segoe WP Light" />
                                    <TextBlock Text="{TemplateBinding Message}" />
                                    <TextBox Name="inputBox"
                                             Binding:TextBinding.UpdateSourceOnChange="True"
                                             InputScope="{TemplateBinding InputScope}"
                                             Text="{TemplateBinding Value}"
                                             AcceptsReturn="True"
                                             TextWrapping="Wrap"
                                             Height="115" />
                                    <StackPanel Name="actionButtonArea"
                                                Orientation="Horizontal"
                                                HorizontalAlignment="Center" />
                                </StackPanel>

                            </Border>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Application.Resources>

    <Application.ApplicationLifetimeObjects>
        <!--Required object that handles lifetime events for the application-->
        <shell:PhoneApplicationService Launching="Application_Launching"
                                       Closing="Application_Closing"
                                       Activated="Application_Activated"
                                       Deactivated="Application_Deactivated" />

        <!-- The application context -->
        <services:ApplicationContext />
        
        <!-- The network watchdog -->
        <services:NetworkWatchdog />
    </Application.ApplicationLifetimeObjects>

</Application>